/*
 * heap.h
 *
 *  Created on: 2012-5-20
 *      Author: hujin
 */

#ifndef HEAP_H_
#define HEAP_H_

#ifndef type_t
#define type_t char
#endif

typedef struct _heap {
	int heap_size;
	int total_size;
	int num_elems;
	type_t * data;
}heap_t;


heap_t * heap_new(int size);
void heap_appenda(heap_t * h, type_t arr[], int len);
void heapify(heap_t *h, int i);
void heap_build_max(heap_t * h);
int heap_exchange(heap_t * h);
void heap_destroy(heap_t *h);


#endif /* HEAP_H_ */
